# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-polyswarm-artifact
pkgname=('python2-polyswarm-artifact' 'python-polyswarm-artifact')
_pkgname=polyswarm-artifact
pkgver=2.0.0
pkgrel=1
pkgdesc='Library containing artifact type enums and functions'
arch=('any')
url='https://pypi.org/project/polyswarm-artifact/#files'
license=('MIT')
makedepends=('python2-setuptools' 'python-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('2e1f8f164f2cc6c10d1bf753927851b62b07de3e7cecb2bec705cc16a1b34746115060828b5cbc398e407c4e9dc48641a61c2e08e00a441ac9172da6182d3560')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-polyswarm-artifact() {
  depends=('python2' 'python2-jsonschema')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

package_python-polyswarm-artifact() {
  depends=('python' 'python-jsonschema')

  cd "$_pkgname-$pkgver"

  python setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

